#ifndef __EPOLL_MONITOR_H_INCLUDED__
#define __EPOLL_MONITOR_H_INCLUDED__

#include "forward_event.h"
#include <sys/epoll.h>

#ifdef __cplusplus
extern "C" {
#endif

class epoll_monitor{

public:

	enum{
		EPOLL_SIZE = 10000
	};

	epoll_monitor();

	~epoll_monitor();

	int init();

	bool is_inited();

	void release();

	int wait(int timeout);

	int monitor_add(int fd, forward_event* ptr_fe, unsigned int epoll_events);

	int monitor_del(int fd);

	epoll_event events[EPOLL_SIZE];

private:

	int epfd;

};

#ifdef __cplusplus
}
#endif

#endif // __EPOLL_MONITOR_H_INCLUDED__
